<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script type="text/javascript"
	src="${ctx}/js/system/datacenter/editEntityUI.js"></script>

<div class="hk_business hk_b_edit">
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${ctx}/datacenter/editFunc.shtml">
		<input type="hidden" class="form-control checkacc"
			value="${formMap.id}" name="datasource_id" id="datasource_id">
		<input type="hidden" name="token" value="${token}" /> 
		<input
			type="hidden" name="id" value="${formMap.ds_func_id}" />
			 <input
			type="hidden" name="func_parent_id" value="${formMap.parentId}" /> 
			<input
			type="hidden" name="name" value="人数套餐" />
			
			<input id="real_pay"
			type="hidden" name="real_pay" value="" />
			
		<section class="panel panel-default">
			<div class="panel-body">

				<div class="form-group">
					<label class="col-sm-3 control-label">客户当前人数套餐：${formMap.spec_value}
						人</label>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">人数套餐：</label> 
					<select
						name="func_id" id="func_id" onchange="show(this)">
						<!-- 后台输出数据 -->
						<option value="0">-- ${datafunctionFormMap.name} --</option>
						<c:forEach items="${datafunctionFormMap.childLists}" var="entity">
							<option value="${entity.id}"  myattr="${entity.price} "   >${entity.spec_value} 
								${entity.unit}</option>
						</c:forEach>
					</select>
				</div>

				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group" style="display: none" id="div"
					>
					<label class="col-sm-3 control-label"> 当select
						选择完毕后触发，然后展示这个div： </label> 
						
						<label class="col-sm-3 control-label" id="lable_id_price" > 你选中的价格是：</label>
				</div>

				<footer class="panel-footer text-right bg-light lter">
					<button type="submit" class="btn btn-success btn-s-xs"
						onclick="checkUser(this);">提交</button>
				</footer>
			</div>
		</section>
	</form>
</div>

<script>
function show(obj) {
	func_id=$("#func_id").find("option:selected").val();
	myattr=$("#func_id").find("option:selected").attr("myattr");
	$("#lable_id_price").html("你选中的价格是:"+myattr);
	document.getElementById("div").style.display = "";
	//alert(document.getElementById("div").style.display)
	var target = document.getElementById('real_pay');
	target.setAttribute('value',myattr);
}
function hidden() {
	document.getElementById("div").style.display = "none";
	//alert(document.getElementById("div").style.display)
}

</script>